package com.he;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.socket.TextMessage;

import com.google.gson.GsonBuilder;
import com.he.websocket.WebsocketHandler;

public class Test extends HttpServlet {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/json;charset=utf-8");
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        PrintWriter out = response.getWriter();
        try {
            LoggerUtil.info("访问test接口\n", this.getClass());
            int i = 1 / 0;
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            LoggerUtil.error(e.getMessage(),this.getClass());
        }
    }
}
